package com.qwt.part_time_api.error;


/**
 * @Author 君子慎独
 * @create 2022/1/4 0004 23:42
 * 包装器业务异常实现
 */
public class BusinessException extends Exception {

    private ErrorCode errorCode;
    private int code;
    private String errorMsg;

    public BusinessException() {
        super();
    }

    public BusinessException(ErrorCode errorCode) {
        super(errorCode.getErrMsg());
        this.errorCode = errorCode;
        this.code = errorCode.getErrCode();
        this.errorMsg = errorCode.getErrMsg();
    }

    public BusinessException(int code, String errorMsg) {
        super(errorMsg);
        this.code = code;
        this.errorMsg = errorMsg;
    }

    public ErrorCode getErrorCode() {
        return errorCode;
    }

    public void setErrorCode(ErrorCode errorCode) {
        this.errorCode = errorCode;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getErrorMsg() {
        return errorMsg;
    }

    public void setErrorMsg(String errorMsg) {
        this.errorMsg = errorMsg;
    }
}
